home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d886.lha / PatchLibrary / CPUClrTEST.c < prev    next >
C/C++ Source or Header  |  1993-07-16  |  744b  |  41 lines

  1. /*
  2.     test for cpuclr
  3.  
  4. */
  5.  
  6. #include <stdio.h>
  7. #include <time.h>
  8. #include <proto/exec.h>
  9. #include <proto/graphics.h>
  10.  
  11. short __chip test[8194];
  12.  
  13. struct GfxBase *GfxBase;
  14.  
  15. void main()
  16. {
  17.     long t1,t2;
  18.     int c=0;
  19.  
  20.     GfxBase=OldOpenLibrary("graphics.library");
  21.     printf("Starting 5000 BltClears()s...\n");
  22.     test[8191]=-1;
  23.     test[8192]=-1;
  24.     test[8193]=-1;
  25.     Forbid();
  26.     time(&t1);
  27.     for(;c<1000;c++) {
  28.         BltClear(test,6,1);
  29.         BltClear(test,4096,1);
  30.         BltClear(test,128,1);
  31.         BltClear(test,16384,5 + (0xaaaa<<16));
  32.         BltClear(test,64 + (256<<16),3);
  33.     }
  34.     time(&t2);
  35.     Permit();
  36.     printf("needed %ld secs\n",t2-t1);
  37.     if(test[8191]) printf("8192 hit with %lx\n",(long)test[8191]);
  38.     if(test[8192]!=-1) printf("8193 hit\n");
  39.     if(test[8193]!=-1) printf("8194 hit\n");
  40. }
  41.